datatable destroy

108

remove previous datatable instance -

//Destroy the old Datatable
$('#equictntbl').DataTable().clear().destroy();

jquery datatable destroy and recreate -

  $("#Table").DataTable().clear().destroy();
            $("#Table").dataTable({
                "sAjaxSource": '@Url.Action("YourMethod", "UrCOntrollerName")',
                "bServerSide": true,
                "bProcessing": false,
                "searching" : false,

                "columns": [
                    {
                        "data": "ID",
                        "autoWidth": true,
                        "searchable": false,
                        "mRender": function (arqs, type, data) {
                            return "<a href='#' onclick='RemoveCombine(this)' data-id='" + data.ID + "'  class='btn-round-sm' title='Remove' style='padding: 5px 5px 5px 5px;'><span>Remove</span></a>";
                        }
                    },

Comments

Submit
0 Comments